<template>
  <el-input
    v-model="inputValue"
    :size="size"
    :placeholder="column.placeholder"
    @input="handleInput"
  />
</template>

<script setup>
import { computed } from 'vue'

const props = defineProps({
  row: Object,
  column: Object,
  index: Number,
  size: {
    type: String,
    default: 'small'
  }
})

const emit = defineEmits(['update'])

const inputValue = computed({
  get: () => props.row[props.column.prop],
  set: (value) => {
    emit('update', value)
  }
})

const handleInput = (value) => {
  emit('update', value)
}
</script>